/**
 * <copyright>
 * </copyright>
 *

 */
package org.eclipse.gittab.gitTabDsl.impl;

import org.eclipse.emf.common.notify.Notification;
import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.InternalEObject;
import org.eclipse.emf.ecore.impl.ENotificationImpl;
import org.eclipse.gittab.gitTabDsl.Chord;
import org.eclipse.gittab.gitTabDsl.ChordDefinition;
import org.eclipse.gittab.gitTabDsl.GitTabDslPackage;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model object '<em><b>Chord</b></em>'.
 * <!-- end-user-doc -->
 * <p>
 * The following features are implemented:
 * <ul>
 *   <li>{@link org.eclipse.gittab.gitTabDsl.impl.ChordImpl#getChord <em>Chord</em>}</li>
 * </ul>
 * </p>
 *
 * @generated
 */
public class ChordImpl extends SoundImpl implements Chord
{
  /**
   * The cached value of the '{@link #getChord() <em>Chord</em>}' reference.
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @see #getChord()
   * @generated
   * @ordered
   */
  protected ChordDefinition chord;

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  protected ChordImpl()
  {
    super();
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  protected EClass eStaticClass()
  {
    return GitTabDslPackage.Literals.CHORD;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ChordDefinition getChord()
  {
    if (chord != null && chord.eIsProxy())
    {
      InternalEObject oldChord = (InternalEObject)chord;
      chord = (ChordDefinition)eResolveProxy(oldChord);
      if (chord != oldChord)
      {
        if (eNotificationRequired())
          eNotify(new ENotificationImpl(this, Notification.RESOLVE, GitTabDslPackage.CHORD__CHORD, oldChord, chord));
      }
    }
    return chord;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public ChordDefinition basicGetChord()
  {
    return chord;
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  public void setChord(ChordDefinition newChord)
  {
    ChordDefinition oldChord = chord;
    chord = newChord;
    if (eNotificationRequired())
      eNotify(new ENotificationImpl(this, Notification.SET, GitTabDslPackage.CHORD__CHORD, oldChord, chord));
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public Object eGet(int featureID, boolean resolve, boolean coreType)
  {
    switch (featureID)
    {
      case GitTabDslPackage.CHORD__CHORD:
        if (resolve) return getChord();
        return basicGetChord();
    }
    return super.eGet(featureID, resolve, coreType);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eSet(int featureID, Object newValue)
  {
    switch (featureID)
    {
      case GitTabDslPackage.CHORD__CHORD:
        setChord((ChordDefinition)newValue);
        return;
    }
    super.eSet(featureID, newValue);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public void eUnset(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.CHORD__CHORD:
        setChord((ChordDefinition)null);
        return;
    }
    super.eUnset(featureID);
  }

  /**
   * <!-- begin-user-doc -->
   * <!-- end-user-doc -->
   * @generated
   */
  @Override
  public boolean eIsSet(int featureID)
  {
    switch (featureID)
    {
      case GitTabDslPackage.CHORD__CHORD:
        return chord != null;
    }
    return super.eIsSet(featureID);
  }

} //ChordImpl
